/*
 * @Description: 书面反馈用的
 * @Author: Zzt
 * @Date: 2022-12-31 13:43:14
 * @LastEditTime: 2022-12-31 14:21:22
 */
import { fetchAllUnit } from '@/api/units';
import { Form, Input, Select } from 'antd';
import TextArea from 'antd/lib/input/TextArea';
import { useEffect, useState } from 'react';

const FormFeedback = (props: any) => {
  const { selectUnit } = props;
  const [unitList, setUnitList] = useState();
  useEffect(() => {
    fetchAllUnit({}).then((res) => {
      console.log(res);
      const unitList = res.data;
      setUnitList(unitList);
    });
  }, []);
  return (
    <>
      <Form.Item name="name" label="书面反馈名称" rules={[{ required: true }]}>
        <Input />
      </Form.Item>
      <Form.Item label="接收单位" name="instructedUnitId" required>
        <Select options={unitList} fieldNames={{ label: 'unitName', value: 'id' }} />
      </Form.Item>
      <Form.Item label="说明" name="remark" rules={[{ required: true }]}>
        <TextArea
          maxLength={2000}
          placeholder={'备注信息描述，最多可填写2000字'}
          showCount={true}
        ></TextArea>
      </Form.Item>
    </>
  );
};
export default FormFeedback;
